package com.cy.listener;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

import com.cy.controller.MasterController;
import com.cy.controller.MusicController;

public class GameTypeListener extends MouseAdapter {

	@Override
	public void mouseClicked(MouseEvent e) {
		MusicController.playSelect();
		MasterController.gameType = !MasterController.gameType;
		JLabel jl = (JLabel)e.getComponent();
		//true 经典
		if(MasterController.gameType) {
			jl.setIcon(new ImageIcon("image/jingdian.jpg"));
		} else {//流行
			jl.setIcon(new ImageIcon("image/liuxing.jpg"));
		}
		MasterController.newGame();
	}
}
